<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/default.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.2.min.js"></script> 
<script src="${pageContext.request.contextPath}/js/jquery.floatbox.10.4.min.js" type="text/javascript"></script>
<script language="JavaScript">
$(document).ready(function(){
	$(".editCategoryValue").click(function () {
	    $.floatbox({
	        ajax: {
	            url: "editCategoryValue.action?categoryValueId="+$(this).attr('id'),
	          //  params: "codeValueId="+$(this).attr('id'), //post parameters
	            before: "<p>Loading content</p>", //loading message while the request is being processed
	            finish: function () {
	               
	            }
	        },
	        fade: true
	    });
	});
	
	$(".editCategoryType").click(function () {
	    $.floatbox({
	        ajax: {
	            url: "editCategoryType.action?categoryTypeId="+$(this).attr('id'),
	          //  params: "codeValueId="+$(this).attr('id'), //post parameters
	            before: "<p>Loading content</p>", //loading message while the request is being processed
	            finish: function () {
	               
	            }
	        },
	        fade: true
	    });
	});
	
	$(".addCategoryValue").click(function () {
	    $.floatbox({
	        ajax: {
	            url: "addCategoryValue.action?categoryTypeId="+$(this).attr('id'),
	          //  params: "codeValueId="+$(this).attr('id'), //post parameters
	            before: "<p>Loading content</p>", //loading message while the request is being processed
	            finish: function () {
	               
	            }
	        },
	        fade: true
	    });
	});
});
</script>
<title>常量管理</title>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
	<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0">
		<form name="myform" method="post" action="?"></form>
  			<tbody>
  				<tr>
      				<td height="100%" valign="top" align="center"> 
        				<table height="100" width="100%" cellspacing="1" cellpadding="5" border="0" bgcolor="#336600">
          					<tbody>
          						<tr> 
            						<td height="25" width="100%" bgcolor="#669900">
            							<strong><font color="#ffffff">常量管理</font></strong>
            						</td>
          						</tr>
					          	<tr> 
					            	<td height="26" bgcolor="#f5f5f5" align="left" colspan="5"> 　 
					              		<input type="submit" value="添加类型" name="Submit3" onClick="location='addCategoryType.action';"/>
					              	</td>
					          	</tr>
          						<tr bgcolor="#ffffff"> 
            						<td align="center">
            							<table height="0%" width="98%" cellspacing="1" cellpadding="3" border="0">
                							<tbody>
                								<tr bgcolor="#669900"> 
							                  		<td height="30%" width="8%" align="center"><font color="#ffffff"><b>序号</b></font></td>
							                  		<td width="16%" align="center"><font color="#ffffff"><b>名称</b></font></td>
							                  		<td width="16%" align="center"><font color="#ffffff"><b>数值</b></font></td>
							                  		<td width="14%" bgcolor="#669900" align="center"><font color="#ffffff"><b>描述</b></font></td>
							                  		<td width="40%" align="center"><font color="#ffffff"><b>操作</b></font></td>
                								</tr>
                								<s:set name="num" value="0"></s:set>
                                               	<s:iterator value="categoryTypes" var="type">
	                								<tr bgcolor="#e7e7e7"> 
	                  									<td height="35%" width="8%" align="center"><s:property value="#num"/></td>
	                  									<td height="35%" width="16%"> 
	                    									<s:property value="name"/>
	                    								</td>
	                    								<td width="40%">
		                    								<table width="100%">
			                    								<tr>
			                    									<td align="center" colspan="3" width="80%" class="curd">
			                    								 		<table width="90%">
			                    								 			<s:iterator value="categoryValues" var="value" status="stut">
					                    								 		<tr>
					                    								  			<td width="50%">
					                    								   				<s:property value="value"/>
					                    								  			</td>
						                    								  		<td class="curd" width="25%">
						                    								    		<img hspace="5" align="absmiddle" src="${pageContext.request.contextPath}/images/admin/delenews.gif" />
						                    								    		<a href='<s:url value="deleteCategoryValue.action"><s:param name="categoryValueId" value="%{#value.id}"/></s:url>' >删除</a>
						                    								  		</td>
							                    								  	<td width="25%" class="curd">
							                    								  		<img hspace="5" align="absmiddle" src="${pageContext.request.contextPath}/images/admin/setuser.gif" />
							                    								   		<a href="#"  class="editCategoryValue" id='<s:property value="#value.id"/>'> 修改</a>
							                    								  	</td>
					                    								  		</tr>
					                    									</s:iterator>
			                    								 		</table>
			                    								 	</td>
			                    								 	<td class="curd">
			                    								    	<img hspace="5" align="absmiddle" src="${pageContext.request.contextPath}/images/admin/package_add.png" />
			                    								    	<a href="#" class="addCategoryValue" id='<s:property value="#type.id"/>'> 新增</a> 
			                    								 	</td>
			                    								</tr>
		                    									
		                    								</table>
	                    								</td>
	                  									<td width="20%"><s:property value="description"/> </td>
	                  									<td height="35%" width="22%" align="center" class="curd">
	                  										<img hspace="5" align="absmiddle" src="${pageContext.request.contextPath}/images/admin/delenews.gif" /><a href='<s:url value="deleteCategoryType.action"><s:param name="categoryTypeId" value="id"/></s:url>' >删除</a> 
	                    									<img hspace="5" align="absmiddle" src="${pageContext.request.contextPath}/images/admin/setuser.gif" /><a href='#' class="editCategoryType" id='<s:property value="id"/>'>修改</a> 
	                  									</td>
	                								</tr>
                									<s:set name="num" value="%{#num+1}"/>
                                              	</s:iterator>
                								<tr bgcolor="#d9d9d7"> 
                  									<td height="35%" bgcolor="#669900" align="right" colspan="5">
                  									</td>
                								</tr>
              								</tbody>
              							</table>
              						</td>
          						</tr>
        					</tbody>
        				</table>
        			</td>
  				</tr>
  			</tbody>
  		</table>
 	</body>
</html>